package com.ktwlsoft.archivemanage.domain.business.repositoryService;

import com.ktwlsoft.archivemanage.domain.dao.entity.ActionSource;
import com.ktwlsoft.archivemanage.domain.dao.repository.IActionSourceMapper;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class ActionSourceRepositoryService {

    private final IActionSourceMapper actionSourceMapper;

    public ActionSourceRepositoryService(IActionSourceMapper actionSourceMapper) {
        this.actionSourceMapper = actionSourceMapper;
    }

    public List<ActionSource> findByRoleId(Long roleId) {
        return actionSourceMapper.findByRoleId(roleId);
    }


    public List<ActionSource> findActionsByUserName(String userName){
        return actionSourceMapper.findByUserName(userName);
    }

    public List<ActionSource> findAllAction() {
        return actionSourceMapper.findAllAction();
    }

    public List<String> findAllActionCode() {
        return actionSourceMapper.findAllActionCodes();
    }

    public List<String> findActionCodeByUserName(String userName) {
        return actionSourceMapper.findActionCodesByUserName(userName);
    }
}
